<template>
  <div class="demo-collapse">
    <el-collapse v-model="activeNames">
      <el-collapse-item title="【公司名称】" name="1">
        <div>
          {{ detailData.company }}
        </div>
      </el-collapse-item>
      <el-collapse-item
        v-show="!!detailData.companyInfo"
        title="【公司简介】"
        name="2"
      >
        <div>
          {{ detailData.companyInfo }}
        </div>
      </el-collapse-item>
      <el-collapse-item
        v-show="!!detailData.department"
        title="【实习部门】"
        name="3"
      >
        <div>
          {{ detailData.department }}
        </div>
      </el-collapse-item>
      <el-collapse-item title="【岗位】" name="4">
        <div>
          {{ detailData.station }}
        </div>
      </el-collapse-item>
      <el-collapse-item title="【薪资待遇】" name="5">
        <div>
          {{
            detailData.salary
              ? detailData.salary.trim()
                ? detailData.salary
                : "面议"
              : "面议"
          }}
        </div>
      </el-collapse-item>
      <el-collapse-item title="【工作地址】" name="6">
        <div>
          {{ detailData.address }}
        </div>
      </el-collapse-item>
      <el-collapse-item title="【工作内容】" name="7">
        <div>
          {{ detailData.work }}
        </div>
      </el-collapse-item>
      <el-collapse-item title="【实习要求】" name="8">
        <div>
          {{ detailData.requirement }}
        </div>
      </el-collapse-item>
      <el-collapse-item
        v-show="!!detailData.obtained"
        title="【实习收获】"
        name="9"
      >
        <div>
          {{ detailData.obtained }}
        </div>
      </el-collapse-item>
      <el-collapse-item title="【邮箱】" name="10">
        <div>
          {{ detailData.email }}
        </div>
      </el-collapse-item>
      <el-collapse-item title="【邮件主题及附件】" name="11">
        <div>
          {{ detailData.emailFormat }}
        </div>
      </el-collapse-item>
      <el-collapse-item title="【简历投递截止时间】" name="12">
        <div>
          {{ detailData.expire?timeFormat(detailData.expire):'未填写' }}
        </div>
      </el-collapse-item>
      <el-collapse-item v-show="!!detailData.notes" title="【备注】" name="13">
        <div>
          {{ detailData.notes }}
        </div>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { timeFormat } from "../utils/practiceUtil";
defineProps({
  detailData: {
    type: Object,
    required: true,
  },
});
const activeNames = ref([
  "1",
  "2",
  "3",
  "4",
  "5",
  "6",
  "7",
  "8",
  "9",
  "10",
  "11",
  "12",
  "13",
]);
//   const handleChange = (val) => {
//     console.log(val)
//   }
</script>
<style scoped>
.el-collapse-item {
  white-space: pre-wrap;
}
</style>
